<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:miria="clr-namespace:MIRIA.UIKit"
             x:Class="MIRIA.Interaction.WiiRemote.WiiRemoteControl"
             Loaded="UserControl_Loaded"
>
	<Grid x:Name="LayoutRoot" Margin="40" HorizontalAlignment="Center">
		
		<Grid.ColumnDefinitions>
			<ColumnDefinition></ColumnDefinition>
			<ColumnDefinition></ColumnDefinition>
		</Grid.ColumnDefinitions>

        <Line Grid.Column="0" Fill="Yellow" Stroke="Yellow" StrokeThickness="8" X1="0" X2="100" Y1="60" Y2="60" StrokeEndLineCap="Triangle">
			<Line.RenderTransform>
				<RotateTransform x:Name="WiiPitchAngle" CenterX="50" CenterY="60" />
			</Line.RenderTransform>
		</Line>
		<Line Grid.Column="1" Fill="Yellow" Stroke="Yellow" StrokeThickness="8" X1="-100" X2="0" Y1="60" Y2="60" StrokeEndLineCap="Triangle" HorizontalAlignment="Right">
			<Line.RenderTransform>
				<RotateTransform x:Name="WiiRollAngle" CenterX="-50" CenterY="60" />
			</Line.RenderTransform>
		</Line>

        <Image Grid.ColumnSpan="2" Source="/MIRIA;component/Images/wiiremote.png" Width="300"></Image>

        <Border Grid.ColumnSpan="2" BorderThickness="4" BorderBrush="White" CornerRadius="10" VerticalAlignment="Center" Margin="0,150" Width="800" Height="150" Canvas.ZIndex="-1" Background="Black" Opacity="0.60">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                <Border x:Name="WiiKeyButton" VerticalAlignment="Center" Background="Black" BorderBrush="White" BorderThickness="2" CornerRadius="23" Margin="30,0,0,0">
                    <StackPanel Orientation="Vertical" Width="160" Height="70">
                        <TextBlock FontSize="11" TextAlignment="Center" Foreground="White">Wii Remote Key</TextBlock>
                        <TextBlock x:Name="WiiKey" Width="140" Height="50" TextAlignment="Center" Canvas.Left="10" Canvas.Top="5" FontSize="28" Foreground="Yellow" Opacity="0.75">-</TextBlock>
                    </StackPanel>
                </Border>
                <Canvas Width="54" Height="74" Margin="50,0,40,0">
                    <TextBlock FontSize="11" TextAlignment="Center" Foreground="White" Canvas.Left="6">Rumble</TextBlock>
                    <miria:TButton x:Name="SwitchRumble" Canvas.Top="16" Width="54" Height="54" Tapped="SwitchRumble_Tapped" Tag="0">
                        <Image Canvas.Left="5" Canvas.Top="5" Source="/MIRIA;component/Images/rumble.png"></Image>
                    </miria:TButton>
                </Canvas>
                <Canvas Width="120"></Canvas>
                <Border VerticalAlignment="Center" Background="Black" BorderBrush="White" BorderThickness="2" CornerRadius="23" Margin="20,0,30,0">
                    <Canvas Width="280" Height="70">
                        <TextBlock Width="200" Canvas.Left="40" TextAlignment="Center" Foreground="White">Wii Remote Leds</TextBlock>
                        <miria:TButton Canvas.Left="20" Canvas.Top="20" Width="40" Height="40" Tapped="WiiLed1_Tapped" VerticalAlignment="Center">
                            <Rectangle x:Name="WiiLed1" Fill="#3333FF" Width="20" Height="20" Tag="1"></Rectangle>
                        </miria:TButton>
                        <miria:TButton Canvas.Left="87" Canvas.Top="20" Width="40" Height="40" Tapped="WiiLed2_Tapped" VerticalAlignment="Center">
                            <Rectangle x:Name="WiiLed2" Fill="#000044" Width="20" Height="20" Tag="0"></Rectangle>
                        </miria:TButton>
                        <miria:TButton Canvas.Left="154" Canvas.Top="20" Width="40" Height="40" Tapped="WiiLed3_Tapped" VerticalAlignment="Center">
                            <Rectangle x:Name="WiiLed3" Fill="#000044" Width="20" Height="20" Tag="0"></Rectangle>
                        </miria:TButton>
                        <miria:TButton Canvas.Left="219" Canvas.Top="20" Width="40" Height="40" Tapped="WiiLed4_Tapped" VerticalAlignment="Center">
                            <Rectangle x:Name="WiiLed4" Fill="#000044" Width="20" Height="20" Tag="0"></Rectangle>
                        </miria:TButton>
                    </Canvas>
                </Border>
            </StackPanel>
        </Border>

        <miria:TButton Grid.ColumnSpan="2" x:Name="Connect" Height="40" Width="160" VerticalAlignment="Bottom" Margin="0,0,0,40" Tapped="Connect_Tapped">
            <TextBlock FontFamily="Georgia" FontSize="18" Foreground="Green">Tap to Connect</TextBlock>
        </miria:TButton>

        <TextBlock Grid.ColumnSpan="2" x:Name="WiiRemoteStatus" Foreground="White" FontFamily="Georgia" VerticalAlignment="Bottom" HorizontalAlignment="Center" FontSize="24">Wii Remote Not Connected =/</TextBlock>

    </Grid>
</UserControl>

